import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import Cookies from "js-cookie";
import Element from "element-ui";
import mitt from "mitt";
import plugins from "./plugins"; // plugins
import "viewerjs/dist/viewer.css";
import VueViewer from "v-viewer";
import directive from "./directive"; // directive

import { download } from "@/utils/request";

import UploadImageOne1 from "@/components/UploadImageOne1";
import UploadImageMore1 from "@/components/UploadImageMore1";
//导出
import ExportButton from "@/components/export-button";

import "uno.css";
import "@/assets/styles/element-variables.scss";
import "@/assets/styles/index.scss"; // global css
import "@/assets/styles/ruoyi.scss"; // ruoyi css
import "viewerjs/dist/viewer.css";

import "@/utils/directives";

// 分页组件
import Pagination from "@/components/Pagination";

Vue.use(Element, {
  size: Cookies.get("size") || "medium", // set element-ui default size
});
Vue.use(plugins);
Vue.use(VueViewer);
Vue.use(directive);

VueViewer.setDefaults({
  title: false,
  minWidth: 640,
  minHeight: 640,
  inline: true, // 是否启用inline模式
  button: false, // 是否显示右上角关闭按钮
  navbar: true, // 是否显示缩略图底部导航栏
  toolbar: true, // 是否显示工具栏
  tooltip: true, // 放大或缩小图片时，是否显示缩放百分比，默认true
  fullscreen: false, // 播放时是否全屏，默认true
  loading: true, // 加载图片时是否显示loading图标，默认true
  loop: true, // 是否可以循环查看图片，默认true
  movable: true, // 是否可以拖动图片，默认true
  zoomable: true, // 是否可以缩放图片，默认true
  zoomRatio: 0.2, //缩放比例
  rotatable: true, // 是否可以旋转图片，默认true
  scalable: true, // 是否可以翻转图片，默认true
  toggleOnDblclick: true, // 放大或缩小图片时，是否可以双击还原，默认true
  transition: false, // 使用 CSS3 过度，默认true
  // url: "data-source",
});
Vue.component("Pagination", Pagination);
Vue.component("UploadImageOne1", UploadImageOne1);
Vue.component("UploadImageMore1", UploadImageMore1);
Vue.component("ExportButton", ExportButton);
Vue.prototype.download = download;
Vue.prototype.$mitt = mitt();
Vue.config.productionTip = false;

new Vue({
  el: "#app",
  router,
  render: (h) => h(App),
});
